package BinaryTree;

import java.util.Scanner;

public class TestBinaryTree {

    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        TreeNode root=binaryTree.createTree();

        System.out.println("======测试一棵树是否是完全二叉树=====");
        System.out.println(binaryTree.isCompleteTree(root));

        System.out.println("======测试非递归前序遍历=====");
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.preOrderNot(root);

        System.out.println();

        System.out.println("======测试非递归中序遍历=====");
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.inOrderNot(root);

        System.out.println();

        System.out.println("======测试非递归后序遍历=====");
        binaryTree.postOrder(root);
        System.out.println();
        binaryTree.postOrderNot(root);

    }
    public static void main1(String[] args) {
        BinaryTree binaryTree=new BinaryTree();
        Scanner sc=new Scanner(System.in);
        while(sc.hasNextLine()) {
            String str=sc.nextLine();
            TreeNode root=binaryTree.createTree(str);

            System.out.println("======测试层序遍历=====");
            binaryTree.levelOrder(root);

            System.out.println("======测试一棵树是否是完全二叉树=====");
            System.out.println(binaryTree.isCompleteTree(root));
        }
    }
}
